<?php
namespace app\api\model;


class Submit extends \think\Model
{

    /**
     * 获取单条
     * @param $id
     * @return array|null|\PDOStatement|string|\think\Model
     */
    public function _findOne($id){
        return $this->where([['id', '=', $id], ['status', '=', 1]])->find();
    }

    /**
    * 通过任务id获取参数
    * @param task_id int
    * @return array
    */
    public function _getList($task_id){
        $list =  $this->field('id, title')->where([['task_id', '=', $task_id], ['status', '=', 1]])->select()->toArray();
        return $list;
    }
}